Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line filters: Regex support #963

Conversation

gtk-grafana
Copy link
Contributor

@gtk-grafana gtk-grafana commented Dec 13, 2024

Adds regex and exclusion support to the line filters.

Fixes: #742
Fixes: #421
Addresses: #758

Note

Breaking UX change:
Line filters must be submitted before they will run queries.

This PR:

  • adds exclusion operations (does not contain)
  • regex operations (does|does not match)
  • provides support for case sensitivity to work with regex/exclusion
  • Upgrades scenes to 5.36
  • allows multiple line filters

Examples

Multiple line filters

image

Regex line filters

image

Exclusion filters from log line context menu

image image

TODOs

Notes for your reviewers:

Part of #952

#958 wasn't going to work, see #958 (comment) for more detail.

@gtk-grafana gtk-grafana changed the title Gtk grafana/issues/952/line filter UI updates line filter var v2 Line filters: Regex support - PoC Dec 13, 2024
@gtk-grafana gtk-grafana mentioned this pull request Dec 13, 2024
10 tasks
…2/line-filter-ui-updates__line-filter-var-v2
@gtk-grafana gtk-grafana self-assigned this Dec 16, 2024
Copy link
Contributor

@matyax matyax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing feature. Left some minor comments.

src/Components/IndexScene/LineFilterVariablesScene.tsx Outdated Show resolved Hide resolved
src/Components/IndexScene/LineFilterVariablesScene.tsx Outdated Show resolved Hide resolved
src/Components/IndexScene/LineFilterVariablesScene.tsx Outdated Show resolved Hide resolved
src/Components/ServiceScene/LineFilter/LineFilterScene.tsx Outdated Show resolved Hide resolved
src/Components/ServiceScene/LogsPanelScene.tsx Outdated Show resolved Hide resolved
src/Components/ServiceScene/ServiceScene.tsx Outdated Show resolved Hide resolved
src/Components/ServiceScene/ServiceScene.tsx Outdated Show resolved Hide resolved
@gtk-grafana gtk-grafana requested a review from matyax January 8, 2025 17:37
@gtk-grafana
Copy link
Contributor Author

Updated to no longer run queries on change, we can follow up with improvements to the debugging UX later.

@gtk-grafana
Copy link
Contributor Author

gtk-grafana commented Jan 8, 2025

Met with @zizzpudding we agreed to kick the debug/editing mode to a follow-up PR, and we tweaked the style of the submit button(s) and removed the include/exclude dropdown from the line filter in the logs tab. Should be a bit more consistent with filters in other sections of the UI now.

Disabled:
image

Enabled:
image

@gtk-grafana
Copy link
Contributor Author

I would say this is ready for final review. Be nice to get this out in 1.0.5, but we can discuss tomorrow

@matyax
Copy link
Contributor

matyax commented Jan 8, 2025

Hard agree with the include/exclude, specially after I saw it in patterns too. I'll take another look in the am. Great work!

@matyax
Copy link
Contributor

matyax commented Jan 9, 2025

Stretch goal, but I would love if you can include a minimal validation to the input, so we can tell the user that something is going to produce errors beforehand:

imagen

Same with the regex. If it would be possible to tell the user if the regex is valid or not before the query runs.

imagen

Definitely as a follow up, but if we can release it along with this it would be perfect.

@matyax
Copy link
Contributor

matyax commented Jan 9, 2025

Idea: could we use a query with line limit 1, not sure if instant would help, to let the user know that a line filter will produce no results before applying? (If the interaction gives time)

@matyax
Copy link
Contributor

matyax commented Jan 9, 2025

The field tab seems to be acting up. Takes me a little bit but I manage to reproduce it to the end. Basically query with error > go to tabs > 0 fields > back to logs > remove error > fields stay in 0.

Fields.mov

@matyax
Copy link
Contributor

matyax commented Jan 9, 2025

Besides what I commented, this seems ready to be merged.

@gtk-grafana
Copy link
Contributor Author

gtk-grafana commented Jan 9, 2025

The field tab seems to be acting up. Takes me a little bit but I manage to reproduce it to the end. Basically query with error > go to tabs > 0 fields > back to logs > remove error > fields stay in 0.

Good catch, I forgot to subscribe to the line-filters and update the detected_fields on change. Will have a fix shortly.
(fix in 511c2eb)

@gtk-grafana gtk-grafana modified the milestones: 1.0.5, 1.0.6 Jan 9, 2025
@gtk-grafana gtk-grafana requested a review from matyax January 9, 2025 12:48
@gtk-grafana
Copy link
Contributor Author

Modified the milestone to 1.0.6, because we're deploying today after the holiday code-freeze we'd like this to have some time in main before going out to users due to the size/complexity of this PR.

Hopefully 1.0.6 can be released next week so it shouldn't be too long of a wait

@gtk-grafana gtk-grafana mentioned this pull request Jan 9, 2025
1 task
Copy link
Contributor

@matyax matyax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 👏

@gtk-grafana gtk-grafana merged commit 80e17e2 into main Jan 9, 2025
4 checks passed
@gtk-grafana gtk-grafana deleted the gtk-grafana/issues/952/line-filter-ui-updates__line-filter-var-v2 branch January 9, 2025 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UX: Filters and line filter log line filters should stay in view like the other filters
2 participants